#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
#if 0
const int N = 10;
int n, m, t, sx, sy, fx, fy, a, b, ans;
int g[N][N];
int dx[5] = { -1,0,1,0,-1 };


void dfs(int x, int y) {
	if (x == fx && y == fy) {
		ans++;
		return;
	}
	for (int i = 0; i < 4; i++) {
		int a = x + dx[i];
		int b = y + dx[i + 1];
		if (a < 1 || b<1 || a>n || b>m || g[a][b] == 1) continue;
		g[a][b] = 1;
		dfs(a, b);
		g[a][b] = 0;
	}
}

int main() {
	cin >> n >> m >> t >> sx >> sy >> fx >> fy;
	for (int i = 0; i < t; i++) {
		cin >> a >> b;
		g[a][b] = 1;
	}
	g[sx][sy] = 1;
	dfs(sx, sy);
	cout << ans;
	return 0;
}
#endif